﻿using System;
using System.IO;
using System.Text;
using test;
namespace test1
{
    class Program
    {
        static void Main(string[] args)
        {
            //    Console.WriteLine("Hello World!");
            //    test.test2 x = new test2("小华",18);
            //    Console.WriteLine(x.Age);
            //    string a = "hdhdldjaoijd小";
            //    int y = a.IndexOf("d小");
            //    _ = a.Substring(y);
            //    string s = "hello word";
            //    StringBuilder k = new StringBuilder("张三");
            //    t3(s);
            string path = @"E:\托管代码\c4\manage\ConsoleApp1\test1\test1.txt";
            string[]contens = File.ReadAllLines(path, Encoding.Default);
            for (int i = 0; i < contens.Length; i++)
            {
                string[] temp = contens[i].Split(' ', StringSplitOptions.RemoveEmptyEntries);
                contens[i] = string.Empty;
                contens[i] = string.Join('|', temp);
            }
        }
        private static StringBuilder t3(string str)
        {
            string[] str2 = str.Split(' ');
            StringBuilder builder = new StringBuilder(str.Length);
            for (int i = str2.Length - 1; i >= 0; i--)
            {
                builder.Append(str2[i]);
                if (i != 0)
                    builder.Append(" ");
            }
            return builder;
        }

    }
}
